home *** CD-ROM | disk | FTP | other *** search
-
- ;Any changes made to this include-file, must also be made in its corresponding
- ;c header-file, monoscope.h
-
- IFND MONOSCOPE
- MONOSCOPE: SET 1
-
- ***************************************************************************************************
- STRUCTURE Monoscope,0 ;MONOSCOPE STRUCTURE
- STRUCT msa_oStep,11*2*2 ;25 - 900 % settings
- APTR msa_oLineData; ;Ptr to precalced data
- APTR msa_oVolListX; ;1/2:Trad vol list x
- APTR msa_oVolListY; ;2/2:Trad vol list y
- APTR msa_oVolList; ;Wrapped vol list
- APTR msa_oVolListXUS; ;1/2:Trad unsigned vol list x
- APTR msa_oVolListYUS; ;2/2:Trad unsigned vol list y
- APTR msa_oVolListUS; ;Wrapped unsigned vol list
- UWORD msa_oWidth; ;1/3:Actual width (pixels)
- UWORD msa_oHeight; ;2/3:Actual height (lines)
- UWORD msa_oPPR; ;3/3:Pixels per row(in memory)
- UWORD msa_oDispX; ;1/2:Display size x (radius!)
- UWORD msa_oDispY; ;2/2:Display size y (radius!)
- UWORD msa_oStore; ;#of pos/angle to store (rad!)
- UWORD msa_oCalcS; ;Calc size x/y(greatest)(rad!)
- UWORD msa_oCalcM; ;Closest gr8r 2^n 2calc (rad!)
- UWORD msa_oCircumF; ;Sum of all borders
- UWORD msa_oCtr; ;Counter-word...
- UBYTE msa_oFlags; ;See below for flags
- UBYTE msa_oSHFlags; ;Copy of ScopeHeader flags
- LABEL Scope_SIZEOF;
- ;Flags to pass to msa_InitData...
- BITDEF MSCP,ALLMODES,0 ;0=just wrapped, 1=also trad & alt
- BITDEF MSCP,NOUNSIGNED,1 ;Set if NOT using unsigned samples
-
- ***************************************************************************************************
- STRUCTURE ScopeHeader,0 ;Channel header to aide in display
- APTR scph_oChannels; ;Ptr to the seq of ScopeChan structs
- ULONG scph_oFreshness; ;Freshness factor, 0=just updated
- UWORD scph_oNumChans; ;Number of channels to display
- UWORD scph_oMaxVolume; ;Max volume for this sound...
- UWORD scph_oMaxChans; ;Number of chans this header points to
- UBYTE scph_oFlags; ;See below for flags...
- UBYTE scph_oPad; ;Pad-byte
- STRUCT scph_oReserved,4*4; ;4 reserved longs
- LABEL scph_SIZEOF;
- ;Flags for scph_oFlags...
- BITDEF SCPH,7BITS,0 ;Set for 7 bit samples
- BITDEF SCPH,8BITS,1 ;Set for 8 bit samples
- BITDEF SCPH,16BITS,2 ;Set for 16 bit samples
- BITDEF SCPH,SIGNED,3 ;Set for signed samples
- BITDEF SCPH,UPDATED,5 ;This structure is being updated
- BITDEF SCPH,DISPLAYED,6 ;This structure is being displayed
- BITDEF SCPH,INVALID,7 ;Struct has been displayed and is now invalid
-
- ***************************************************************************************************
- STRUCTURE ScopeChannel,0 ;Channel struct to use in display
- APTR scpc_oExtChan; ;May point to a corresponding external channel structure
- ULONG scpc_oSampleLeft; ;1/5:Bytes left of sample until loop
- APTR scpc_oSamplePos; ;2/5:Current sample's position
- ULONG scpc_oLoopSize; ;3/5:Size of loop
- APTR scpc_oSampleLoop; ;4/5:Current sample's loop address
- ULONG scpc_oFreq; ;5/5:Frequency (may be used by ext player)
- UWORD scpc_oVolume; ;Current channel's volume
- UBYTE scpc_oFlags; ;No flags defined yet!
- STRUCT scpc_oPad,5; ;5 pad-bytes
- LABEL scpc_SIZEOF;
-
- ***************************************************************************************************
- ;Macros...
- LOOP.L: Macro ;32 bit loop down to ZERO
- subq.l #1,\1
- bne \2
- Endm
-
- NEXT.L: Macro ;31 bit loop down to NEG
- subq.l #1,\1
- bge \2
- Endm
-
- LOOP: Macro ;16 bit loop down to ZERO
- subq.w #1,\1
- bne \2
- Endm
-
- NEXT: Macro ;15 bit loop down to NEG
- subq.w #1,\1
- bge \2
- Endm
-
- ;MOV = Move source to dest
- ;M1 = Subtract 1 from dest
- ;C = Clear destination before moving a word to it
- ;A = Address register version
- ;S = Swap destination when done
-
- MOVM1.L: Macro
- move.l \1,\2
- subq.l #1,\2
- Endm ;\2.l = (\1.l - 1)
- MOVM1: Macro
- move.w \1,\2
- subq.w #1,\2
- Endm ;\2.w = (\1.w - 1)
- MOVM1C: Macro
- moveq #0,\2
- move \1,\2
- sub #1,\2
- Endm ;\2.l = (\1.w - 1)
- MOVM1CA: Macro
- suba.l \2,\2
- move \1,\2
- sub #1,\2
- Endm ;\2.l = (\1.w - 1)
- MOVM1CS: Macro
- moveq #0,\2
- move \1,\2
- sub #1,\2
- swap \2
- Endm ;swap (\2.l=(\1.w-1))
- MOVC: Macro
- moveq #0,\2
- move \1,\2
- Endm ;\2.l = \1.w
- MOVCS: Macro
- moveq #0,\2
- move \1,\2
- swap \2
- Endm ;swap (\2.l = \1.w)
- MOVCA: Macro
- suba.l \2,\2
- move \1,\2
- Endm ;\2.l = \1.w
-
- ENDC ;MONOSCOPE
-